Skip to content

Conversation

@rafals26
Copy link

My use case is that I use the module to create a Cloud Run instance and then a Github Actions pipeline to deploy subsequent revisions.
The problem is that Github Actions deployment adds several new fields (like client_version) to the resource, which causes state drift:

  ~ resource "google_cloud_run_v2_service" "main" {
      - client                  = "gcloud" -> null
      - client_version          = "548.0.0" -> null
        id                      = "xyz"
        name                    = "xyz"
        # (35 unchanged attributes hidden)

      ~ template {
          ~ labels                           = {
              - "commit-sha"                 = "c6fafd63075cb23b53e763e427e877dd8669f999" -> null
              - "goog-terraform-provisioned" = "true" -> null
              - "managed-by"                 = "github-actions" -> null
            }
            # (9 unchanged attributes hidden)
            }

            # (1 unchanged block hidden)
        }

        # (2 unchanged blocks hidden)
    }

This small change adds lifecycle_ignore to ignore those changes. Identical code is already present in v1 resource version of the module: https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/blob/main/main.tf#L191

@rafals26 rafals26 marked this pull request as ready for review November 19, 2025 14:03
@rafals26 rafals26 requested review from a team, anamer, ayushmjain, prabhu34 and q2w as code owners November 19, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant